package cn.ikun.xk.JDBC;

import java.sql.*;

public class AppJdbcDelete {
    public static void main(String[] args) throws Exception{
        Class.forName("com.mysql.jdbc.Driver");
        String url = "jdbc:mysql://localhost:3306/baga?useSSL=false";
        String username = "root";
        String password = "xk20011216";
        Connection connection = DriverManager.getConnection(url, username, password);


        Statement statement = connection.createStatement();

        String sql = "DELETE FROM jk_user WHERE id = 2";
        int i = statement.executeUpdate(sql);
        if (i>0){
            System.out.println("删除成功");
        }


    }
}
